<?php

namespace App\Controller\Exam;

use App\Dao\Exam\ExamDao;
use App\Service\Exam\ExamService;
use Hyperf\Di\Annotation\Inject;
use Yj\Apidog\Annotation\ApiController;
use Yj\Apidog\Annotation\FormData;
use Yj\Apidog\Annotation\PostApi;

/**
 * @ApiController(prefix="exam")
 */
class ExamController extends BaseController
{
    /**
     * @Inject()
     * @var ExamService
     */
    protected $examService;

    /**
     * @PostApi(path="lists")
     */
    public function lists(){
        $data = $this->examService->lists();
        _SUCCESS($data);
    }

    public function detail(){
        
    }

    /**
     * @PostApi(path="question")
     * @FormData(key="exam_id",rule="required")
     */
    public function question()
    {
        $exam_id = $this->getValidatorData('exam_id');

        $data = $this->examService->question($exam_id);
        _SUCCESS($data);
    }
}